﻿
using DataBase;
using DataBase.DBmodels;
using Prism.Commands;
using Prism.Mvvm;
using System.Collections.ObjectModel;
using System.Windows;
using static GreenXi.Help.UI.MultiComboBox;

namespace GreenXi.Model
{
    public class CraftModel : BindableBase
    {

        public DelegateCommand<object> SelectionChangeColumn { get; set; }
        public DelegateCommand SwitchPress { get; set; }


        private string _IsVisibility = "Collapsed";
        public string IsVisibility
        {
            get { return _IsVisibility; }
            set { SetProperty(ref _IsVisibility, value); }
        }

        #region 分组的增删改查移动
        public DelegateCommand<object> EditColumn { get; set; }

    

        public DelegateCommand<object> MoveColumn { get; set; }

        public DelegateCommand<object> DelColumn { get; set; }

        public DelegateCommand<object> SaveColumn { get; set; }
        public DelegateCommand<object> CloseWindows { get; set; }
        #endregion

        #region 项目的增删改查
        public DelegateCommand<object> EditProject { get; set; }

        public DelegateCommand AddProject { get; set; }

        public DelegateCommand<object> MoveProjectUp { get; set; }

        public DelegateCommand<object> MoveProjectDown { get; set; }

        public DelegateCommand<object> DelProject { get; set; }

        public DelegateCommand<object> SaveProject { get; set; }
        #endregion

        private ObservableCollection<Craft> _CraftList;
        public ObservableCollection<Craft> CraftList
        {
            get => _CraftList;
            set
            {
                SetProperty(ref _CraftList, value);
            }
        }


        private ObservableCollection<Region> _RegionList;
        public ObservableCollection<Region> RegionList
        {
            get => _RegionList;
            set
            {
                SetProperty(ref _RegionList, value);
            }
        }
        /// <summary>
        /// 网关列表
        /// </summary>
        private ObservableCollection<Gateway> _GatewayList;
        public ObservableCollection<Gateway> GatewayList
        {
            get => _GatewayList;
            set
            {
                SetProperty(ref _GatewayList, value);
            }
        }



        private Craft _Crafts;
        public Craft Crafts
        {
            get
            {
                if (_Crafts.ShowType == "压力")
                {
                    Unit = "kn";
                    Protect = "最大位移:";
                    ProtectUnit = "mm";
                }
                else if (_Crafts.ShowType == "位移")
                {
                    Unit = "mm";
                    Protect = "最大压力:";
                    ProtectUnit = "kn";
                }
                else if (_Crafts.ShowType == "等待")
                {
                    Unit = "s";
                    Protect = "最大压力:";
                    ProtectUnit = "kn";
                }
                return _Crafts;
            }
            set
            {
                SetProperty(ref _Crafts, value);
            }
        }



       

        /// <summary>
        /// 模式
        /// </summary>
        private ObservableCollection<string> _SportsMode;
        public ObservableCollection<string> SportsMode
        {
            get => _SportsMode;
            set
            {
                SetProperty(ref _SportsMode, value);
            }
        }


        private Visibility _Power;
        public Visibility Power
        {
            get => _Power;
            set
            {
                SetProperty(ref _Power, value);
            }
        }
        private Visibility _Displacement;
        public Visibility Displacement
        {
            get => _Displacement;
            set
            {
                SetProperty(ref _Displacement, value);
            }
        }
        private bool _Press1;
        public bool Press1
        {
            get => _Press1;
            set
            {
                SetProperty(ref _Press1, value);
            }
        }
        private bool _Press2;
        public bool Press2
        {
            get => _Press2;
            set
            {
                SetProperty(ref _Press2, value);
            }
        }

        /// <summary>
        /// 单位
        /// </summary>
        private string _Unit;
        public string Unit
        {
            get => _Unit;
            set
            {
                SetProperty(ref _Unit, value);
            }
        }

        /// <summary>
        /// 保护单位
        /// </summary>
        private string _ProtectUnit;
        public string ProtectUnit
        {
            get => _ProtectUnit;
            set
            {
                SetProperty(ref _ProtectUnit, value);
            }
        }

        /// <summary>
        /// 设置保护的介绍
        /// </summary>
        private string _Protect;
        public string Protect
        {
            get => _Protect;
            set
            {
                SetProperty(ref _Protect, value);
            }
        }

        private ObservableCollection<MultiCbxBaseData>? _Multi;
        public ObservableCollection<MultiCbxBaseData>? Multi
        {
            get => _Multi;
            set
            {
                _Multi = value;
            }
        }


    }
}
